using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsServerTools._ManageData
{
    /// <summary>
    /// <para>Calculate Field</para>
    /// <para>Creates a layer with calculated field values.</para>
    /// <para>创建具有计算字段值的图层。</para>
    /// </summary>    
    [DisplayName("Calculate Field")]
    public class CalculateField : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CalculateField()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_layer">
        /// <para>Input Layer</para>
        /// <para>The input features that will have a field calculated.</para>
        /// <para>将计算字段的输入要素。</para>
        /// </param>
        /// <param name="_output_name">
        /// <para>Output Name</para>
        /// <para>The name of the output feature service.</para>
        /// <para>输出要素服务的名称。</para>
        /// </param>
        /// <param name="_field_name">
        /// <para>Field Name</para>
        /// <para>The name of the field that will have values calculated. This can be an existing field or a new field name.</para>
        /// <para>将计算值的字段的名称。这可以是现有字段，也可以是新字段名称。</para>
        /// </param>
        /// <param name="_field_type">
        /// <para>Field Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the field type for the calculated field.</para>
        ///   <bulletList>
        ///     <bullet_item>String—Any string of characters</bullet_item><para/>
        ///     <bullet_item>Integer—Whole numbers</bullet_item><para/>
        ///     <bullet_item>Double— Fractional numbers</bullet_item><para/>
        ///     <bullet_item>Date— Date</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定计算字段的字段类型。</para>
        ///   <bulletList>
        ///     <bullet_item>字符串 - 任意字符串</bullet_item><para/>
        ///     <bullet_item>整数 - 整数</bullet_item><para/>
        ///     <bullet_item>双精度 - 小数</bullet_item><para/>
        ///     <bullet_item>Date— 日期</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_expression">
        /// <para>Expression</para>
        /// <para>Calculates values in the field. Expressions are written in Arcade and can include [+ - * / ] operators and multiple fields. Calculated values are applied in the units of the spatial reference of the input unless you are using a geographic coordinate system, in which case they will be in meters.</para>
        /// <para>计算字段中的值。表达式是在 Arcade 中编写的，可以包括 [+ - * / ] 运算符和多个字段。计算值将以输入的空间参考单位应用，除非您使用的是地理坐标系，在这种情况下，它们将以米为单位。</para>
        /// </param>
        public CalculateField(object _input_layer, object _output_name, object _field_name, _field_type_value? _field_type, object _expression)
        {
            this._input_layer = _input_layer;
            this._output_name = _output_name;
            this._field_name = _field_name;
            this._field_type = _field_type;
            this._expression = _expression;
        }
        public override string ToolboxName => "GeoAnalytics Server Tools";

        public override string ToolName => "Calculate Field";

        public override string CallName => "geoanalytics.CalculateField";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_input_layer, _output_name, _field_name, _field_type.GetGPValue(), _expression, _track_aware.GetGPValue(), _track_fields, _data_store.GetGPValue(), _output_table, _time_boundary_split, _time_boundary_reference];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The input features that will have a field calculated.</para>
        /// <para>将计算字段的输入要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_layer { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para>The name of the output feature service.</para>
        /// <para>输出要素服务的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_name { get; set; }


        /// <summary>
        /// <para>Field Name</para>
        /// <para>The name of the field that will have values calculated. This can be an existing field or a new field name.</para>
        /// <para>将计算值的字段的名称。这可以是现有字段，也可以是新字段名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field_name { get; set; }


        /// <summary>
        /// <para>Field Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the field type for the calculated field.</para>
        ///   <bulletList>
        ///     <bullet_item>String—Any string of characters</bullet_item><para/>
        ///     <bullet_item>Integer—Whole numbers</bullet_item><para/>
        ///     <bullet_item>Double— Fractional numbers</bullet_item><para/>
        ///     <bullet_item>Date— Date</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定计算字段的字段类型。</para>
        ///   <bulletList>
        ///     <bullet_item>字符串 - 任意字符串</bullet_item><para/>
        ///     <bullet_item>整数 - 整数</bullet_item><para/>
        ///     <bullet_item>双精度 - 小数</bullet_item><para/>
        ///     <bullet_item>Date— 日期</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _field_type_value? _field_type { get; set; }

        public enum _field_type_value
        {
            /// <summary>
            /// <para>Date</para>
            /// <para>Date— Date</para>
            /// <para>Date— 日期</para>
            /// </summary>
            [Description("Date")]
            [GPEnumValue("DATE")]
            _DATE,

            /// <summary>
            /// <para>Double</para>
            /// <para>Double— Fractional numbers</para>
            /// <para>双精度 - 小数</para>
            /// </summary>
            [Description("Double")]
            [GPEnumValue("DOUBLE")]
            _DOUBLE,

            /// <summary>
            /// <para>Integer</para>
            /// <para>Integer—Whole numbers</para>
            /// <para>整数 - 整数</para>
            /// </summary>
            [Description("Integer")]
            [GPEnumValue("INTEGER")]
            _INTEGER,

            /// <summary>
            /// <para>String</para>
            /// <para>String—Any string of characters</para>
            /// <para>字符串 - 任意字符串</para>
            /// </summary>
            [Description("String")]
            [GPEnumValue("STRING")]
            _STRING,

        }

        /// <summary>
        /// <para>Expression</para>
        /// <para>Calculates values in the field. Expressions are written in Arcade and can include [+ - * / ] operators and multiple fields. Calculated values are applied in the units of the spatial reference of the input unless you are using a geographic coordinate system, in which case they will be in meters.</para>
        /// <para>计算字段中的值。表达式是在 Arcade 中编写的，可以包括 [+ - * / ] 运算符和多个字段。计算值将以输入的空间参考单位应用，除非您使用的是地理坐标系，在这种情况下，它们将以米为单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Expression")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _expression { get; set; }


        /// <summary>
        /// <para>Track Aware</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the expression will use a track-aware expression.
        ///   <bulletList>
        ///     <bullet_item>Checked—The expression will use a track-aware expression, and a track field must be specified.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The expression will not use a track-aware expression. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定表达式是否使用跟踪感知表达式。
        ///   <bulletList>
        ///     <bullet_item>选中 - 表达式将使用轨迹感知表达式，并且必须指定轨迹字段。</bullet_item><para/>
        ///     <bullet_item>未选中 - 表达式将不使用可识别轨迹的表达式。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Track Aware")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _track_aware_value? _track_aware { get; set; } = null;

        public enum _track_aware_value
        {
            /// <summary>
            /// <para>TRACK_AWARE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("TRACK_AWARE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_TRACK_AWARE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_TRACK_AWARE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Track Fields</para>
        /// <para>One or more fields that will be used to identify unique tracks.</para>
        /// <para>将用于标识唯一轨迹的一个或多个字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Track Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _track_fields { get; set; } = null;


        /// <summary>
        /// <para>Data Store</para>
        /// <para><xdoc>
        ///   <para>Specifies the ArcGIS Data Store where the output will be saved. The default is Spatiotemporal big data store. All results stored in a spatiotemporal big data store will be stored in WGS84. Results stored in a relational data store will maintain their coordinate system.</para>
        ///   <bulletList>
        ///     <bullet_item>Spatiotemporal big data store—Output will be stored in a spatiotemporal big data store. This is the default.</bullet_item><para/>
        ///     <bullet_item>Relational data store—Output will be stored in a relational data store.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将保存输出的 ArcGIS Data Store。默认值为 Spatiotemporal 大数据存储。存储在时空大数据存储中的所有结果都将存储在 WGS84 中。存储在关系数据存储中的结果将保留其坐标系。</para>
        ///   <bulletList>
        ///     <bullet_item>时空大数据存储 - 输出将存储在时空大数据存储中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>关系数据存储 - 输出将存储在关系数据存储中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Data Store")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _data_store_value _data_store { get; set; } = _data_store_value._SPATIOTEMPORAL_DATA_STORE;

        public enum _data_store_value
        {
            /// <summary>
            /// <para>Spatiotemporal big data store</para>
            /// <para>Spatiotemporal big data store—Output will be stored in a spatiotemporal big data store. This is the default.</para>
            /// <para>时空大数据存储 - 输出将存储在时空大数据存储中。这是默认设置。</para>
            /// </summary>
            [Description("Spatiotemporal big data store")]
            [GPEnumValue("SPATIOTEMPORAL_DATA_STORE")]
            _SPATIOTEMPORAL_DATA_STORE,

            /// <summary>
            /// <para>Relational data store</para>
            /// <para>Relational data store—Output will be stored in a relational data store.</para>
            /// <para>关系数据存储 - 输出将存储在关系数据存储中。</para>
            /// </summary>
            [Description("Relational data store")]
            [GPEnumValue("RELATIONAL_DATA_STORE")]
            _RELATIONAL_DATA_STORE,

        }

        /// <summary>
        /// <para>Output Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output_table { get; set; }


        /// <summary>
        /// <para>Time Boundary Split</para>
        /// <para>A time span to split the input data into for analysis. A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, starting on January 1, 1980, tracks will be split at the beginning of every day. This parameter is only available with ArcGIS Enterprise 10.7 and later.</para>
        /// <para>将输入数据拆分为以进行分析的时间跨度。时间边界允许您在定义的时间跨度内分析值。例如，如果使用 1 天的时间边界，则从 1980 年 1 月 1 日开始，轨迹将在每天开始时进行拆分。此参数仅适用于 ArcGIS Enterprise 10.7 及更高版本。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Split")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_split { get; set; } = null;


        /// <summary>
        /// <para>Time Boundary Reference</para>
        /// <para>The reference time used to split the input data into for analysis. Time boundaries will be created for the entire span of the data, and the reference time does not need to occur at the start. If no reference time is specified, January 1, 1970, is used. This parameter is only available with ArcGIS Enterprise 10.7 and later.</para>
        /// <para>用于将输入数据拆分为用于分析的参考时间。将为数据的整个跨度创建时间边界，并且参考时间不需要在开始时出现。如果未指定参考时间，则使用 1970 年 1 月 1 日。此参数仅适用于 ArcGIS Enterprise 10.7 及更高版本。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Reference")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_reference { get; set; } = null;


        public CalculateField SetEnv(object extent = null, object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}